package p270jp.pxv.android.activity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.dynamiclinks.internal.DynamicLinkData;
import java.util.Objects;
import p014ae.AbstractActivityC0068e1;
import p270jp.pxv.android.model.Routing;
import p270jp.pxv.android.model.RoutingParameter;
import p350mp.Timber;
import p488sa.FirebaseDynamicLinks;
import p488sa.PendingDynamicLinkData;
import p539u9.FirebaseApp;

/* renamed from: jp.pxv.android.activity.IntentFilterActivity */
/* loaded from: classes2.dex */
public class IntentFilterActivity extends AbstractActivityC0068e1 {

    /* renamed from: jp.pxv.android.activity.IntentFilterActivity$a */
    /* loaded from: classes2.dex */
    public class C4013a implements OnFailureListener {
        public C4013a() {
            IntentFilterActivity.this = r1;
        }

        @Override // com.google.android.gms.tasks.OnFailureListener
        public void onFailure(Exception exc) {
            Timber.f23100a.mo3514p(exc);
            IntentFilterActivity intentFilterActivity = IntentFilterActivity.this;
            IntentFilterActivity.m4816V0(intentFilterActivity, intentFilterActivity.getIntent().getData());
        }
    }

    /* renamed from: jp.pxv.android.activity.IntentFilterActivity$b */
    /* loaded from: classes2.dex */
    public class C4014b implements OnSuccessListener<PendingDynamicLinkData> {
        public C4014b() {
            IntentFilterActivity.this = r1;
        }

        @Override // com.google.android.gms.tasks.OnSuccessListener
        public void onSuccess(PendingDynamicLinkData bVar) {
            String str;
            PendingDynamicLinkData bVar2 = bVar;
            if (bVar2 != null) {
                IntentFilterActivity intentFilterActivity = IntentFilterActivity.this;
                DynamicLinkData dynamicLinkData = bVar2.f26164a;
                Uri uri = null;
                if (!(dynamicLinkData == null || (str = dynamicLinkData.f10011b) == null)) {
                    uri = Uri.parse(str);
                }
                IntentFilterActivity.m4816V0(intentFilterActivity, uri);
                return;
            }
            IntentFilterActivity intentFilterActivity2 = IntentFilterActivity.this;
            IntentFilterActivity.m4816V0(intentFilterActivity2, intentFilterActivity2.getIntent().getData());
        }
    }

    /* renamed from: V0 */
    public static void m4816V0(IntentFilterActivity intentFilterActivity, Uri uri) {
        Objects.requireNonNull(intentFilterActivity);
        RoutingParameter convertRoutingParameter = RoutingParameter.convertRoutingParameter(uri);
        if (convertRoutingParameter.getRouting() == Routing.NONE) {
            if (uri != null) {
                uri.toString();
            }
            super.startActivity(new Intent(intentFilterActivity, RoutingActivity.class));
            intentFilterActivity.finish();
            return;
        }
        Intent intent = new Intent(intentFilterActivity, RoutingActivity.class);
        intent.putExtra("ROUTING", convertRoutingParameter);
        super.startActivity(intent);
        intentFilterActivity.finish();
    }

    @Override // p270jp.pxv.android.activity.BaseActivity, androidx.fragment.app.FragmentActivity, androidx.activity.ComponentActivity, p248j2.ActivityC3902g, android.app.Activity
    public void onCreate(Bundle bundle) {
        FirebaseDynamicLinks aVar;
        super.onCreate(bundle);
        synchronized (FirebaseDynamicLinks.class) {
            FirebaseApp b = FirebaseApp.m1799b();
            synchronized (FirebaseDynamicLinks.class) {
                b.m1800a();
                aVar = (FirebaseDynamicLinks) b.f27209d.mo12159a(FirebaseDynamicLinks.class);
            }
            aVar.mo1924a(getIntent()).addOnSuccessListener(this, new C4014b()).addOnFailureListener(this, new C4013a());
        }
        aVar.mo1924a(getIntent()).addOnSuccessListener(this, new C4014b()).addOnFailureListener(this, new C4013a());
    }
}
